package com.stoken.web;

public class StokenUtils {
	/**
	 * 控制项目分页控件每页显示数量
	 */
	public static int pageSize = 10;

	public static String REGISTERGRADE = "registerGrade";
	
	public static final String LOGINACCOUNT= "loginAccount";
	
	public static final double COPPERMONEY = 1000D;
	
	public static final double SILVERMONEY = 3000D;
	
	public static final double GOLDENMONEY = 6000D;
	
	public static final double VIPMONEY = 10000D;
	
	public static final double MASONRYMONEY = 20000D;
	
	public static final String ACCESS_ROLE = "USER_LOGIN";

	public static final String ADMIN_ACCESS_ROLE = "backstage";
	
	public static final String SERVICE_PROVIDERS_ACCESS_ROLE = "merchant";
	
	public static final String ACCESS_SECOND_PWD = "SECOND_PWD";
	
	public static final String ACCESS_THIRD_PWD = "THIRD_PWD";
	
	public static final String PARENT_URL = "PARENT_URL";
	
	public static final String PARENT_THIRD_URL = "PARENT_THIRD_URL";
	
	/**
	 * 对碰奖金
	 */
	public static final double HITBOUNS = 0.12D;
	
	/**
	 * 直接推荐奖金
	 */
	public static final double REFERRALBONUS = 0.10D;
	
	/**
	 * 领导一代
	 */
	public static final double LEADERSHIPBONUS_FIRST = 0.30D;
	
	/**
	 * 领导二代
	 */
	public static final double LEADERSHIPBONUS_SECOND = 0.20d;
	
	/**
	 * 领导三代
	 */
	public static final double LEADERSHIPBONUS_THIRD = 0.10d;
	

	/**
	 * 领导四代
	 */
	public static final double LEADERSHIPBONUS_FOURTH = 0.10d;
	
	/**
	 * 碰对单位
	 */
	public static final int UNIT = 1000;
	
	
	
	/**
	 * 根据注册等级计算出业绩单数
	 * @param classLevel
	 * @return
	 */
	public static int getAchievementByClassLevel(int classLevel){
		int achievemnt = 0;
		switch (classLevel) {
			case 1:
				achievemnt = (int)COPPERMONEY/UNIT;
				break;
			case 2:
				achievemnt = (int)SILVERMONEY/UNIT;
				break;
			case 5:
				achievemnt = (int)GOLDENMONEY/UNIT;
				break;
			case 10:
				achievemnt = (int)VIPMONEY/UNIT;
				break;
			case 30:
				achievemnt = (int)MASONRYMONEY/UNIT;
				break;
			default:
				break;
		}
		return achievemnt;		
	}
	
	/**
	 * 根据会员等级得到该会员对碰奖金限额
	 * @param level
	 * @return
	 */
	public static int getMaxHitBonus(int level){
		int maxHit = 0;
		switch (level) {
			case 1:
				maxHit = (int)COPPERMONEY;
				break;
			case 2:
				maxHit = (int)SILVERMONEY;
				break;
			case 5:
				maxHit = (int)GOLDENMONEY;
				break;
			case 10:
				maxHit = (int)VIPMONEY;
				break;
			case 30:
				maxHit = (int)VIPMONEY;
				break;
			default:
				break;
		}
		return maxHit;		
		
	}
	
	

}
